export default {
  //获取stroage
  getStroage(key) {
    return JSON.parse(window.localStorage.getItem(key) || "{}");
  },
  //存储
  set(key, val) {
    window.localStorage.setItem(key, JSON.stringify(val));
  },
  //获取
  get(key) {
    return this.getStroage(key);
  },
  //删除单个
  clear(key) {
    window.localStorage.setItem(key, "");
  },
  //删除所有
  clearAll() {
    window.localStorage.clear();
  },
};
